package com.yycx.module.bus.provider.handler.haiying.salemanbalance;

import com.yycx.bpm.provider.common.handler.ProcInstDeleteHandler;
import com.yycx.common.constants.CommonConstants;
import com.yycx.common.mybatis.model.ResultBody;
import com.yycx.module.bus.provider.service.BusPaymentService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 资保金收款单撤销审批
 *
 * @author zyf
 */
@Component
public class HySaleManBalanceProcDeleteHandler implements ProcInstDeleteHandler {

    @Resource
    private BusPaymentService paymentService;


    @Override
    public boolean support(String processDefinitionKey) {
        return true;
    }

    @Override
    public ResultBody success(String businessKey, String processInstanceId) {
        paymentService.updatePaymentState(businessKey, null, CommonConstants.INT_0);
        return ResultBody.ok();
    }
}
